#pragma once

#include <memory>
#include "SRMacro.h"

namespace sora
{
	class Renderer;
	class RenderApp;

	class Renderer {
	public:
		Renderer() { }
		virtual ~Renderer() { }

		virtual void init() = 0;
		virtual void resize(int w, int h) = 0;
		virtual void render() = 0;
		virtual void done() = 0;

		void setApp(RenderApp *app);
		RenderApp &app() const;
		bool appExist() const;
	private:
		std::auto_ptr<RenderApp> app_;
	};

	class RenderApp {
	public:
		RenderApp() {}
		virtual ~RenderApp() {}

		virtual void init() = 0;
		virtual void deinit() = 0;
		virtual void render(long tick, int width, int height) = 0;
	};
}
